<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>register</title>
    <script src="js/jquery.js"></script>
    <script type="application/javascript">
        $(document).on("click","#btn",function () {
            $.ajax({
                url:"returningString.do",
                data:{
                    id:1005,
                    name:"张三"
                },
                type:"post",
                dataType:"json",
                success:function success(resp) {
                    $.each(function (i,n) {
                        console.log(n);
                    })
                }
            })
        })


    </script>
</head>
<body>
<div style="text-align: center;">
    <form action="/register.do" method="post">
        学号：<input type="text" name="id"> </br>
        姓名：<input type="text" name="name"> </br>
        <input type="submit" value="注册">
    </form>
    <br/>
    <form action="" method="post">
        学号：<input type="text" name="id"> </br>
        姓名：<input type="text" name="name"> </br>
    </form>
    <br>
    <button id="btn">ajax注册</button>

</div>
</body>
</html>